package com.pms.service;



import com.pms.dao.RecorderDao;

import com.pms.entity.Recoder;
import com.pms.util.DateUtil;
import com.pms.util.PKUtil;
import com.pms.util.Page;

public class RecoderService {
	RecorderDao dao=new RecorderDao();
	public Recoder save(String desc,String userId,String contactId){
		Recoder recoder=new Recoder();
		recoder.setRecoderId(PKUtil.getPkId());
		recoder.setDesc(desc);
		recoder.setCreateTime(DateUtil.getNow());
		recoder.setUserId(userId);
		recoder.setContactId(contactId);
		
		dao.save(recoder);
		return recoder;
	}
	
	
	public Page<Recoder> findByUserIdAndContactId(String contactId,int pageNum){
		Page<Recoder> page=new Page<Recoder>(5,dao.getCount(),pageNum);
		return dao.findByUserIdAndContactId(contactId,page);
	}
	
	public void delRecoder(String contactId){
		dao.delRecoder(contactId);
		
	}
	
}
